<?php $frmuser = $this->frmaccess;
$cancel_url = $this->url(array('module'=>'users','controller'=>'user-type','action'=>'index'),null,true);
$data = $this->fraccess;
?>
<style>
thead tr th{font-size: 13px; text-align: center !important;}
td{font-size: 14px; text-align: center !important;}
#select_top #user_access_chosen{ margin-top: -25px !important;}
</style>
<form class="form-horizontal" id="popup-validation" enctype="multipart/form-data" method="post">
<div class="row">
	<div class="col-lg-12">
		<div class="box" style="width: 95%; margin: 0 auto;">
			<header class="dark">
				<div class="icons"><i class="icon-ok"></i></div>
					<h5>កំណត់សិទ្ធអ្នកប្រើប្រាស់</h5>
                    <div style="float: right; margin-top: 4px;margin-right: 5px;">				
						<?php //$add_url = $this->url(array('module'=>'users','controller'=>'user-access','action'=>'edit'),null,true);?>
						<?php $url = $this->url(array('module'=>'users','controller'=>'user-access','action'=>''),null,true);?>
							<button type="submit" name="save" class="btn btn-primary btn-sm btn-grad"><i class="icon-plus-sign"></i> រក្សាទុក  </button>					
						<button type="submit" name="update" class="btn btn-primary btn-sm btn-grad"><i class="icon-save"></i> រក្សាទុក​ និង​ ចាកចេញ ​ </button>
						<a href="<?php echo $url;?>">
							<button type="button" name="delete"​​ class="btn btn-danger btn-sm btn-grad"><i class="icon-remove-sign"></i> ចាកចេញ​​ ​ </button>
						</a>
						<a class="accordion-toggle btn btn-xs minimize-box" data-toggle="collapse" href="#collapse2">
                        <i class="icon-chevron-up"></i>
                        </a>
                        <button class="btn btn-xs btn-primary close-box"><i class="icon-group"></i></button>
					</div>
          	</header>
			<div id="collapse2" class="body collapse in">
					<div class="form-group col-lg-6" style="float: left;"> 
						<label class="control-label col-lg-5">កំណត់សិទ្ធអ្នកប្រើប្រាស់​​ : </label>                   	
                        <div class="col-lg-7" id="select_top">                        
                        	<?php echo $frmuser->getElement('user_access');?>
                        </div>
               		</div>
               		<div class="form-group col-lg-6" style="float: right;">
               		<label class="control-label col-lg-5">​​​ ប្រភេទឈ្មោះអ្នកប្រើប្រាស់​​   :  </label>                    	
                        <div class="col-lg-6">                        	
                        	<input type="text" value="<?php echo $data['user_type'];?>" class="form-control" disabled="disabled" />
                        </div>
               		</div>
               		<div style="clear: both; margin-bottom: 10px;"></div>
           	</div>
		</div>
	</div>
</div>
<div class="row">
	<div class="col-lg-12">
		<div class="box" style="width: 95%; margin: 0 auto;">
			<header class="dark">
				<div class="icons"><i class="icon-ok"></i></div>
					<h5>កំណត់សិទ្ធអ្នកប្រើប្រាស់លើ  Module, Controller និង​  Action </h5>
                    <div style="float: right; margin-top: 4px;margin-right: 5px;">	
                    	<button type="submit" name="search" class="btn btn-primary btn-sm btn-grad"><i class="icon-search"></i> ស្វែងរក ​ </button>			
						<a class="accordion-toggle btn btn-xs minimize-box" data-toggle="collapse" href="#collapse2">
                        <i class="icon-chevron-up"></i>
                        </a>
                        <button class="btn btn-xs btn-primary close-box"><i class="icon-group"></i></button>
					</div>
          	</header>
			<div id="collapse2" class="body collapse in">
				<div class="panel-body">
		 			<div class="table-responsive">
		 				<table class="table">
							<tr class="height">
								<td>Module : </td>
								<td width="30%"><select  name="fmod" class="form-control chzn-select" ><?php echo $this->optoin_mod;?></select></td>	
								<td>Controller : </td>
								<td width="30%"><select  class='form-control chzn-select' name="fcon" id="fcon"><?php echo $this->optoin_con;?></select></td>				
								<td>Index :</td>
								<td><select name="fact" class='form-control chzn-select' id="fact"><?php echo $this->optoin_act;?></select></td>	
							</tr>			
						</table>
						<table class="table table-striped table-bordered table-hover" id="dataTables-example">
							<thead>
								<tr>
									<th>ល.រ</th>
		                        	<th>ប្រអប់</th>
		                            <th>ប្រភេទអ្នកប្រើប្រាស់</th>
		                        	<th> Module, Controller និង​  Action</th>
		                        	<th>ស្ដានការ</th>
		                        	<th>លុបចោល</th>
		                       </tr>
		                  	</thead>
		                    <tbody>
		                    <?php $i = 1;?>
		                    <?php foreach($this->frmacl as $data){?>
		                    	<tr class="odd gradeX">
		                    		<td><?php echo $i++;?></td>
		                        	<td><span class=""><input class="uniform" name="checkBox" value="<?php echo $data['id'];?>" type="checkbox"></span></td>
		                        	<td><?php echo $data['user_type'];?></td>
		                       		<td><?php echo $data['user_access'];?></td>
		                        	<td>
		                        		<?php if($data['status']== 1){?>
		                        		<button type="submit" name="status" value="<?php echo $data['id'];?>" class="btn btn-primary btn-sm btn-grad" "><i class="icon-off"></i></button>
		                        		<?php }else {?>
		                        		<button type="submit" name="unstatus"  value="<?php echo $data['id'];?>" class="btn btn-danger btn-sm btn-grad" "><i class="icon-off"></i></button>
		                        		<?php }?>
		                        	</td>
		                        	<td class="center">
		                        		<?php $delete_url = $this->url(array('module'=>'users','controller'=>'user-access','action'=>'delete'),null,true);?>
		                        		<a href="<?php echo $delete_url?>/id/<?php echo $data['id'];?>"><button type="button" class="btn btn-danger btn-xs btn-grad"><i class="icon-remove icon-white"></i>​ លុបចោល</button></a>
		                        	</td>
		                   		</tr>
		                    <?php } ?>                   
		               		</tbody>
		  				</table>
		 			</div>
				</div>
           	</div>
		</div>
	</div>
</div>
</form>